package com.sugar.follow.up.module.business.controller.app.userpatient.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

import static com.sugar.follow.up.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "APP - 就诊人 Response VO")
@Data
public class AppUserPatientDetailRespVO {

    @Schema(description = "就诊人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25165")
    private Long id;

    @Schema(description = "姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    private String name;

    @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String mobile;

    @Schema(description = "身份证号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String idCard;

    @Schema(description = "出生日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonSerialize(using = LocalDateSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate birthday;

    @Schema(description = "省市区（逗号分隔）", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<String> location;

    @Schema(description = "详细地址", requiredMode = Schema.RequiredMode.REQUIRED)
    private String locationDetail;

    @Schema(description = "ID号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String idCode;

    @Schema(description = "确诊年龄", requiredMode = Schema.RequiredMode.REQUIRED)
    private String confirmedDiagnosisAge;

    @Schema(description = "特病症（0否 1是）", requiredMode = Schema.RequiredMode.REQUIRED)
    private Boolean specialIllness;

    @Schema(description = "心脑血管系统既往病史（字典：business_user_patient_xnxg_type）")
    private List<String> xnxgHistory;

    @Schema(description = "神经系统既往病史（字典：business_user_patient_sj_type）")
    private List<String> sjHistory;

    @Schema(description = "呼吸系统既往病史（字典：business_user_patient_hx_type）")
    private List<String> hxHistory;

    @Schema(description = "消化系统既往病史（字典：business_user_patient_xh_type）")
    private List<String> xhHistory;

    @Schema(description = "血液系统既往病史（字典：business_user_patient_xy_type）")
    private List<String> xyHistory;

    @Schema(description = "内分泌系统既往病史（字典：business_user_patient_nfm_type）")
    private List<String> nfmHistory;

    @Schema(description = "其它既往病史")
    private String otherHistory;

    @Schema(description = "常用药物")
    private String commonlyUsedDrugs;

    @Schema(description = "风险等级（字典：business_user_patient_risk_level）", requiredMode = Schema.RequiredMode.REQUIRED)
    private String riskLevel;
}
